package TestSchoolSubjects;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class Test2{
	public static Object readObjectFromFile()
    {
        Object temp = null;
        File file = new File("./file/test1.ser");
        FileInputStream in;
        try {
            in = new FileInputStream(file);
            ObjectInputStream objIn = new ObjectInputStream(in);
            temp = objIn.readObject();
            objIn.close();
            System.out.println("Read object success!");
        } catch (IOException e) {
            System.out.println("Read object failed");
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return temp.toString();
    }
	public static void main(String[] args) {
		System.out.println(readObjectFromFile());
		
	}
}